// some comment

using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
using System.Diagnostics;

namespace Ltf.MonitorLizard.Helpers
{
	[Serializable]
	public struct ShellExecuteInfo
	{
		public int Size;
		public uint Mask;
		public IntPtr hwnd;
		public string Verb;
		public string File;
		public string Parameters;
		public string Directory;
		public uint Show;
		public IntPtr InstApp;
		public IntPtr IDList;
		public string Class;
		public IntPtr hkeyClass;
		public uint HotKey;
		public IntPtr Icon;
		public IntPtr Monitor;
	}

	/// <summary>
	/// Used for launching the windows file properties window
	/// </summary>
	public class FilePropertiesLauncher
	{


		[DllImport("Shell32.dll")]
		public static extern int ShellExecuteEx(ref ShellExecuteInfo sei);

		/// <summary>
		/// Shows the properties.
		/// </summary>
		/// <param name="strFilename">The STR filename.</param>
		/// <param name="hWnd">The h WND.</param>
		public static void ShowProperties(string strFilename, IntPtr hWnd)
		{
			uint SW_SHOW = 5;
			uint SEE_MASK_INVOKEIDLIST = 12;
			ShellExecuteInfo ei = new ShellExecuteInfo();
			ei.Size = System.Runtime.InteropServices.Marshal.SizeOf(typeof(ShellExecuteInfo));
			ei.Mask = SEE_MASK_INVOKEIDLIST;
			ei.Verb = "properties";
			ei.File = strFilename;
			ei.Parameters = null;
			ei.Directory = null;
			ei.hwnd = hWnd;
			ei.Show = SW_SHOW;	

			int result = ShellExecuteEx(ref ei);
		}

	}
}
